From 72943beab6ee04ec2ff2ecb456b562bda89f1bb6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Thu, 25 May 2006 14:31:28 +0000 Subject: [PATCH] * And the rest needed for $wgGrammarForms support --- languages/LanguageBs.php | 4 ++++ languages/LanguageCs.php | 4 ++++ languages/LanguageFi.php | 5 +++++ languages/LanguageGa.php | 5 +++++ languages/LanguageLa.php | 5 +++++ languages/LanguageRu.php | 5 +++++ languages/LanguageSk.php | 5 +++++ languages/LanguageSl.php | 5 +++++ languages/LanguageTyv.php | 5 +++++ 9 files changed, 43 insertions(+) diff --git a/languages/LanguageBs.php b/languages/LanguageBs.php index 5b318c522f..10313f1d8a 100644 --- a/languages/LanguageBs.php +++ b/languages/LanguageBs.php @@ -183,6 +183,10 @@ class LanguageBs extends LanguageUtf8 { # Convert from the nominative form of a noun to some other case # Invoked with {{GRAMMAR:case|word}} function convertGrammar( $word, $case ) { + global $wgGrammarForms; + if ( isset($wgGrammarForms[$case][$word]) ) { + return $wgGrammarForms[$case][$word]; + } switch ( $case ) { case 'genitiv': # genitive if ( $word == 'Wikipedia' ) { diff --git a/languages/LanguageCs.php b/languages/LanguageCs.php index 169a65bbc0..9e36d39109 100644 --- a/languages/LanguageCs.php +++ b/languages/LanguageCs.php @@ -192,6 +192,10 @@ class LanguageCs extends LanguageUtf8 { # Grammatical transformations, needed for inflected languages # Invoked by putting {{grammar:case|word}} in a message function convertGrammar( $word, $case ) { + global $wgGrammarForms; + if ( isset($wgGrammarForms[$case][$word]) ) { + return $wgGrammarForms[$case][$word]; + } # allowed values for $case: # 1sg, 2sg, ..., 7sg -- nominative, genitive, ... (in singular) switch ( $word ) { diff --git a/languages/LanguageFi.php b/languages/LanguageFi.php index f0e4d9bd19..e18306403d 100644 --- a/languages/LanguageFi.php +++ b/languages/LanguageFi.php @@ -193,6 +193,11 @@ class LanguageFi extends LanguageUtf8 { # Convert from the nominative form of a noun to some other case # Invoked with {{GRAMMAR:case|word}} function convertGrammar( $word, $case ) { + global $wgGrammarForms; + if ( isset($wgGrammarForms[$case][$word]) ) { + return $wgGrammarForms[$case][$word]; + } + # These rules are not perfect, but they are currently only used for site names so it doesn't # matter if they are wrong sometimes. Just add a special case for your site name if necessary. switch ( $case ) { diff --git a/languages/LanguageGa.php b/languages/LanguageGa.php index 592a1857f3..d25e8c2fee 100644 --- a/languages/LanguageGa.php +++ b/languages/LanguageGa.php @@ -175,6 +175,11 @@ class LanguageGa extends LanguageUtf8 { # Convert day names # Invoked with {{GRAMMAR:transformation|word}} function convertGrammar( $word, $what ) { + global $wgGrammarForms; + if ( isset($wgGrammarForms[$case][$word]) ) { + return $wgGrammarForms[$case][$word]; + } + switch ( $what ) { case 'genitive': switch ($word) { diff --git a/languages/LanguageLa.php b/languages/LanguageLa.php index 289086d63c..b27a39c3f8 100644 --- a/languages/LanguageLa.php +++ b/languages/LanguageLa.php @@ -94,6 +94,11 @@ class LanguageLa extends LanguageUtf8 { * Rules are far from complete. */ function convertGrammar( $word, $case ) { + global $wgGrammarForms; + if ( isset($wgGrammarForms[$case][$word]) ) { + return $wgGrammarForms[$case][$word]; + } + switch ( $case ) { case 'genitive': // 1st and 2nd declension singular only. diff --git a/languages/LanguageRu.php b/languages/LanguageRu.php index 5ffad05938..a37bdd48f1 100644 --- a/languages/LanguageRu.php +++ b/languages/LanguageRu.php @@ -162,6 +162,11 @@ class LanguageRu extends LanguageUtf8 { # Convert from the nominative form of a noun to some other case # Invoked with {{grammar:case|word}} function convertGrammar( $word, $case ) { + global $wgGrammarForms; + if ( isset($wgGrammarForms[$case][$word]) ) { + return $wgGrammarForms[$case][$word]; + } + # These rules are not perfect, but they are currently only used for site names so it doesn't # matter if they are wrong sometimes. Just add a special case for your site name if necessary. diff --git a/languages/LanguageSk.php b/languages/LanguageSk.php index 864c9e02d0..6cf472cc4e 100644 --- a/languages/LanguageSk.php +++ b/languages/LanguageSk.php @@ -177,6 +177,11 @@ class LanguageSk extends LanguageUtf8 { # Convert from the nominative form of a noun to some other case # Invoked with {{GRAMMAR:case|word}} function convertGrammar( $word, $case ) { + global $wgGrammarForms; + if ( isset($wgGrammarForms[$case][$word]) ) { + return $wgGrammarForms[$case][$word]; + } + switch ( $case ) { case 'genitív': if ( $word == 'Wikipédia' ) { diff --git a/languages/LanguageSl.php b/languages/LanguageSl.php index f19e1b1e2f..2adaac85b6 100644 --- a/languages/LanguageSl.php +++ b/languages/LanguageSl.php @@ -100,6 +100,11 @@ class LanguageSl extends LanguageUtf8 { # Convert from the nominative form of a noun to some other case # Invoked with {{GRAMMAR:case|word}} function convertGrammar( $word, $case ) { + global $wgGrammarForms; + if ( isset($wgGrammarForms[$case][$word]) ) { + return $wgGrammarForms[$case][$word]; + } + switch ( $case ) { case 'rodilnik': # genitive if ( $word == 'Wikipedija' ) { diff --git a/languages/LanguageTyv.php b/languages/LanguageTyv.php index 995066ac03..e6544d62ab 100644 --- a/languages/LanguageTyv.php +++ b/languages/LanguageTyv.php @@ -99,6 +99,11 @@ class LanguageTyv extends LanguageUtf8 { * @return string */ function convertGrammar( $word, $case ) { + global $wgGrammarForms; + if ( isset($wgGrammarForms[$case][$word]) ) { + return $wgGrammarForms[$case][$word]; + } + // Set up some constants... $allVowels = array("е", "и", "э", "ө", "ү", "а", "ё", "о", "у", "ы", "ю", "я", "a", "e", "i", "o", "ö", "u", "ü", "y"); -- 2.20.1